package org.git.movie.controller;


import com.alibaba.fastjson.JSONObject;
import org.git.movie.annotations.Verify;
import org.git.movie.service.FfNavService;
import org.git.movie.service.FfVodService;
import org.git.movie.util.BaseController;
import org.git.movie.util.BaseResponse;
import org.git.movie.vo.FfNavVO;
import org.git.movie.vo.IndexNavVodDto;
import org.git.movie.vo.RepNavListDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  电影首页
 * </p>
 *
 */
@RestController
@RequestMapping("video")
public class FfIndexController extends BaseController {


    @Resource
    private FfVodService ffVodService;


    @PostMapping("index.do")
    public BaseResponse<JSONObject> findIndex( @Verify(param="navVodLength",rule="required|min(1)|max(21)") int navVodLength){


        List<IndexNavVodDto> list = ffVodService.findIndex(navVodLength);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("list",list);
        return ok(jsonObject);
    }




}

